import * as types from '@/store/mutation-types.js';
import { setStore, removeStore } from '@/common/util';

export default {
    //设置详情页信息
    [types.SET_DETAILS] (state, details) {
        console.log(state, details)
        if (details) {
            setStore('details', details)
            state.details = details;
        } else {
            state.details = null;
            removeStore('details')
        }
    },
    [types.SET_SIZE] (state, size) {
        if (size) {
            setStore('size', size)
            state.size = size;
        } else {
            removeStore('size')
            state.size = null;
        }
    },
    [types.SET_THEME] (state, theme) {
        setStore('theme', theme)
        state.theme = theme;
    },
}
